package cn.study.luckyadapter.controller.admin;

import cn.study.common.annotation.ResponseResult;
import cn.study.luckyapp.server.AwardServiceImpl;
import cn.study.luckyclient.api.IAwardService;
import cn.study.luckyclient.dto.AwardAddCmd;
import cn.study.luckyclient.dto.AwardUpdateCmd;
import cn.study.luckyclient.dto.data.AwardVo;
import cn.study.luckyclient.dto.query.AwardListByParamQuery;
import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
@AllArgsConstructor
@ResponseResult
@RequestMapping("admin/v1/award")
public class AdminAwardController {
    private final IAwardService awardService;
    @PostMapping("/add")
    public AwardVo add(@RequestBody AwardAddCmd cmd){
        return awardService.add(cmd);
    }
    @PostMapping("/update")
    public AwardVo update(@RequestBody AwardUpdateCmd cmd){
        return awardService.update(cmd);
    }
    @GetMapping("/page")
    public IPage<AwardVo> page(@RequestBody AwardListByParamQuery query){
        return awardService.page(query);
    }
}
